package circulate_algorithm_study;

import java.util.Scanner;


public class Average_Find {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int sumA = 0, sumB = 0, countA = 0, countB = 0;
        for (int i = 1; i <= n; i++) {
            if (i % k != 0) {
                countB++;
                sumB += i;
            } else {
                countA++;
                sumA += i;
            }
        }
        double averageA = (double) sumA / countA;
        double averageB = (double) sumB / countB;
        System.out.printf("%.1f",averageA);
        System.out.print(" ");
        System.out.printf("%.1f",averageB);
    }
}

